{% extends "cms/cms_book.html" %}

{% block title %}
    <title>借阅信息查询</title>
{% endblock %}

{% block book_body %}
    <h5 class="text-center">还书业务</h5>
    <table class="table">
      <thead>
        <tr>
          <th scope="col">图书名</th>
          <th scope="col">借书时间</th>
          <th scope="col">借阅者</th>
          <th scope="col">状态</th>
          <th scope="col">操作</th>
        </tr>
      </thead>
      <tbody>
        {% for book in books %}
            <tr>
                <td>{{ book.name }}</td>
                <td>{{ book.borrow_time }}</td>
                <td>{{ book.username }}</td>
                <td>
                    {% if book.is_return == 0 %}
                        <span class="text-danger">未归还</span>
                    {% else %}
                        <span class="text-success">已归还</span>
                    {% endif %}
                </td>
                <td>
                    {% if book.is_return ==0 %}
                        <button type="button" class="btn btn-danger btn-return_book" data-user-id="{{ book.user_id }}"  data-book-id="{{ book.book_id }}">归还</button>

                    {% endif %}
                </td>
            </tr>
        {% endfor %}
      </tbody>
    </table>
{% endblock %}